<template>
    <div>
        用户名：<input type="text" v-model="title">
        <br>
        内容：
        <br>
        <textarea name="" id="" cols="30" rows="10" v-model="conts"></textarea>
        <br>
        <button @click="add()">添加</button>
    </div>
</template>
<script>
export default {
    data() {
        return {
            title:'伐开心n',
            conts:'都发给你机会给乙方推荐你'
        }
    },
    methods:{
        add(){
            var time = this.getNowTime()
            let obj = {
                    title:this.title,
                    wenben:this.conts,
                    time:time
                }
            this.$emit('abcdef',obj)
        },
         getNowTime(){
            var dtime = new Date();
            var nian = dtime.getFullYear(),
            yue = dtime.getMonth()+1,
            day = dtime.getDate(),
            hours = dtime.getHours(),
            fen = dtime.getMinutes(),
            miao = dtime.getSeconds()
            return nian+"-"+yue+"-"+day+" "+hours+":"+fen+":"+miao
        },
    }
}
</script>